home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / util1 / wrip_22.lha / WRip / XFD / DeCloner.asm < prev    next >
Assembly Source File  |  1995-11-07  |  4KB  |  158 lines

  1. ;*---------------------------------------------------------------------------
  2. ;  :Program.    DeCloner.asm
  3. ;  :Contents.   Decruncher for XFDMaster.Library (various clones)
  4. ;  :History.    V 0.1 08.11.95
  5. ;  :Copyright.  Public Domain
  6. ;  :Language.   68000 Assembler
  7. ;  :Translator. Barfly V1.130
  8. ;---------------------------------------------------------------------------*
  9. ;##########################################################################
  10.  
  11.     INCDIR    Includes:
  12.     INCLUDE    lvo/exec.i
  13.     INCLUDE    libraries/xfdmaster.i
  14.     INCLUDE    libraries/xfdmaster_lib.i
  15.  
  16. ;##########################################################################
  17. ;----------------------------------------
  18. ; XFD-Library-Header
  19.  
  20.         moveq    #-1,d0
  21.         rts    
  22.  
  23.         dc.l    XFDF_ID        ;id
  24.         dc.w    XFDF_VERSION    ;version
  25.         dc.w    0
  26.         dc.l    0,0        ;private
  27.         dc.l    _xfdSlave1    ;first slave
  28.  
  29. ;----------------------------------------
  30. ; version string
  31.  
  32.         dc.b    '$VER: DeCloner V0.1 '
  33.     DOSCMD    "WDate >T:date"
  34.     INCBIN    T:date
  35.         dc.b    ' by WEPL for xfdmaster.library',0
  36.     EVEN
  37.  
  38. ;----------------------------------------
  39. ; xfdSlave-structure
  40.  
  41. _xfdSlave1    dc.l    _xfdSlave2    ; next slave
  42.         dc.w    XFDS_VERSION    ; structure version
  43.         dc.w    33        ; req xfdmaster version
  44.         dc.l    .name        ; cruncher name
  45.         dc.w    XFDPFF_DATA    ; cruncher flags
  46.         dc.w    0        ; max length of special info (passwd)
  47.         dc.l    .check        ; check routine
  48.         dc.l    .decrunch    ; decrunch routine
  49.         dc.l    0        ; segment recog routine
  50.         dc.l    0        ; segment decrunch routine
  51.  
  52. .name        dc.b    'CHFI (IMP! clone)',0
  53.     EVEN
  54.  
  55. ;----------------------------------------
  56. ; code to check crunched
  57. ; Übergabe :    D0 = ULONG data size
  58. ;        A0 = APTR  data
  59. ; Rückgabe :    D0 = BOOL  success
  60.  
  61. .check        moveq    #32,d1        ;minimum 32 bytes
  62.         cmp.l    d1,d0
  63.         blo    .no
  64.         cmp.l    #"CHFI",(a0)
  65.         bne    .no
  66.         moveq    #-1,d0
  67.         rts
  68. .no        moveq    #0,d0
  69.         rts
  70. .decrunch    move.l    #"IMP!",d0
  71.         bra    _CloneMaster
  72.  
  73. ;----------------------------------------
  74. ; xfdSlave-structure
  75.  
  76. _xfdSlave2    dc.l    _xfdSlave3    ; next slave
  77.         dc.w    XFDS_VERSION    ; structure version
  78.         dc.w    33        ; req xfdmaster version
  79.         dc.l    .name        ; cruncher name
  80.         dc.w    XFDPFF_DATA    ; cruncher flags
  81.         dc.w    0        ; max length of special info (passwd)
  82.         dc.l    .check        ; check routine
  83.         dc.l    .decrunch    ; decrunch routine
  84.         dc.l    0        ; segment recog routine
  85.         dc.l    0        ; segment decrunch routine
  86.  
  87. .name        dc.b    'Z&G! (S404 clone)',0
  88.     EVEN
  89. .check        moveq    #22,d1        ;minimum 22 bytes
  90.         cmp.l    d1,d0
  91.         blo    .no
  92.         cmp.l    #"Z&G!",(a0)
  93.         bne    .no
  94.         moveq    #-1,d0
  95.         rts
  96. .no        moveq    #0,d0
  97.         rts
  98. .decrunch    move.l    #"S404",d0
  99.         bra    _CloneMaster
  100.  
  101. ;----------------------------------------
  102. ; xfdSlave-structure
  103.  
  104. _xfdSlave3    dc.l    0        ; next slave
  105.         dc.w    XFDS_VERSION    ; structure version
  106.         dc.w    33        ; req xfdmaster version
  107.         dc.l    .name        ; cruncher name
  108.         dc.w    XFDPFF_DATA    ; cruncher flags
  109.         dc.w    0        ; max length of special info (passwd)
  110.         dc.l    .check        ; check routine
  111.         dc.l    .decrunch    ; decrunch routine
  112.         dc.l    0        ; segment recog routine
  113.         dc.l    0        ; segment decrunch routine
  114.  
  115. .name        dc.b    'LR88 (PP20 clone)',0
  116.     EVEN
  117. .check        moveq    #16,d1        ;minimum 16 bytes
  118.         cmp.l    d1,d0
  119.         blo    .no
  120.         cmp.l    #"LR88",(a0)
  121.         bne    .no
  122.         moveq    #-1,d0
  123.         rts
  124. .no        moveq    #0,d0
  125.         rts
  126. .decrunch    move.l    #"PP20",d0
  127.         bra    _CloneMaster
  128.  
  129. ;----------------------------------------
  130. ; mastercode to decrunch the file
  131. ; Übergabe :    D0 = LONG new ID
  132. ;        A0 = APTR xfdBufferInfo
  133. ; Rückgabe :    D0 = BOOL success
  134.  
  135. _CloneMaster    move.l    (xfdbi_SourceBuffer,a0),a1
  136.         move.l    (a1),-(a7)            ;save old ID
  137.         move.l    d0,(a1)                ;write new
  138.         move.l    a0,-(a7)            ;save xfdBufferInfo
  139.         jsr    (_LVOxfdRecogBuffer,a6)
  140.         tst.l    d0
  141.         beq    .error
  142.         move.l    (a7),a0
  143.         jsr    (_LVOxfdDecrunchBuffer,a6)
  144.         move.l    (a7)+,a0
  145. .cleanup    move.l    (xfdbi_SourceBuffer,a0),a1
  146.         move.l    (a7)+,(a1)            ;restore old ID
  147.         rts
  148.  
  149. .error        move.l    (a7)+,a0
  150.         move.w    #XFDERR_UNKNOWN,(xfdbi_Error,a0)
  151.         moveq    #0,d0
  152.         bra    .cleanup
  153.         
  154. ;##########################################################################
  155.  
  156.     END
  157.  
  158.